<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./assets/js/vue.js"></script>
    <link rel="stylesheet" href="./assets/font/iconfont.css">
    <style>
        #wrap{
            margin-top: 120px;
            width: 400px;
            height: 70px;
            padding: 0 10px ;
            border-bottom: 1px solid #d8d8d8;
            font-size: 24px;
        }
        #wrap>div:first-of-type{
            height: 35px;
            color:#7a7a7a ;
            box-sizing: border-box;
            display: flex;
            justify-content: space-between;
        }
        #wrap>div:first-of-type>div>button{
            border: 0;
            background-color: white;
        }
        #wrap>div:last-of-type>input{
            border: 0;
            outline: 0;
            width: 400px;
        }
        .passfont{
            color:#2b93d9 ;
            font-size: 16px;
            line-height: 0px;
            transition: all 400ms ease-in;
        }
        .border{
            border-bottom: 1px solid #2b93d9;   
        }
        .spancolor{
            color:#2b93d9 ;
        }
    </style>
</head>
<body>
    <div id="app">
        <div id="wrap":style="flag==true? `border-bottom: 1px solid #2b93d9;`: ''"  @blur="mode='blur'" >
            <div :class="flag==true? 'passfont': ''"   >
                <div>
                    <span :class="flag==true? 'spancolor': ''">Password</span>
                </div>
                <div @click="t= t=='readonly'? 'disabled':'readonly'" :style="flag==true? '':`display: none;`">
                    <button :[t]='true' :style="t=='readonly'? `border: 2px solid black;border-radius: 5px;`:''">
                        <span class="iconfont icon-eye"></span>
                    </button>
                </div>
            </div>
            <div>
                <input :type="t=='disabled'? 'password':'text'" @focus="flag=true" >
            </div>
        </div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                flag:false,
                t:"disabled",
            }
        })
    </script>
</body>
</html>